import request from '@/utils/http.js'

// 保存首页轮播广告
export const saveAdvertiseApi = (data) => {
  return request({
    url: 'sms/backend/advertise/save',
    method: "POST",
    data: JSON.stringify(data),
  })
}

// 查询广告列表
export const getAdvertiseListApi = (params) => {
  return request({
    url: 'sms/backend/advertise/list',
    method: "GET",
    params: params,
  })
}

// 查询单个广告的详细信息
export const getAdvertiseInfoApi = (id) => {
  return request({
    url: `sms/backend/advertise/info/${id}`,
    method: "GET",
  })
}

// 修改
export const updateAdvertiseInfoApi = (data) => {
  return request({
    url: 'sms/backend/advertise/update',
    method: "PUT",
    data: data,
  })
}

// 删除
export const deleteAdvertiseApi = (ids) => {
  return request({
    url: 'sms/backend/advertise/delete',
    method: "DELETE",
    data: JSON.stringify(ids),
  })
}